package logic.weapons.projectileWeapons.artillary;

import com.jme.math.Vector3f;
import com.jme.scene.Node;

import logic.ships.Ship;
import logic.weapons.WeaponType;
import logic.weapons.projectileWeapons.Projectile;
import logic.weapons.projectileWeapons.ProjectileWeapon;
import main.InitGame;

public class ArtillaryWeapon extends ProjectileWeapon {
	
	private static final long serialVersionUID = 1L;
	
	public ArtillaryWeapon(Node model, String path, String title, ArtillaryProperties properties, Ship ship) {
		super(model, path, title, properties, ship);

		removeController(weaponController);
		
		if(InitGame.get().isServer()) {
			weaponController = new ArtillaryWeaponController(this);
			addController(weaponController);
		}
	}
	
	@Override
	protected Projectile createProjectile(Vector3f direction, Node projectileModel, Vector3f startLoc, boolean dummy) {
		return new ArtillaryMissile(ship, projectileModel, direction, startLoc, getArtillaryProperties(), this, dummy);
	}
	
	public ArtillaryProperties getArtillaryProperties() { return (ArtillaryProperties)properties; }
	
	@Override
	public WeaponType getWeaponType() { return WeaponType.Artillary; }
}